define(['angular'], function(angular) {
    angular.module('services', [])
        .factory('header', [function() {
            return {
                templateUrl: '../template/header.html',
                refreshUrl: '../template/refresh.html',
                pwdkeyboardUrl: '../template/pwdKeyBoard.html',
                homePath: '../home/index.html'
            };
        }]).factory('keypad', ['$timeout', function($timeout) {
            return {
        			pwd: {
		            	// 键盘获取
		                getValue: function(keypadStr, no) {
		                    // 验证
		                    keypadStr += no;
		                    keypadStr = (keypadStr.length <= 6) ? keypadStr : keypadStr.slice(0, 6);
		                    return keypadStr;
		                }
        			}
            };
        }]).factory('bizProxy', ['$http','$rootScope','$timeout', function($http,$rootScope,$timeout) {
        	return {
        		queryProxyBizData : function(serviceName, headerInfo, bizInfo, successCallBackFn, failCallBackFn) {
        				yhc.biz(serviceName,headerInfo,bizInfo,
    		    				function(ret){
    		    					if(ret != "" && ret != null && ret != '{}' && ret != 'null'){
    		    						var tempData = JSON.parse(ret);
    		    						if(tempData.isSuccess == "T"){
    		    							successCallBackFn(tempData);
    		    						}else{
    		    							failCallBackFn(tempData);
    		    						}
    		    					}else{
    		    						if(serviceName == "userLogin"){
    		    							failCallBackFn("");
    		    						}else{
    		    							failCallBackFn({"errorMsg":"网络异常"});
    		    						}
    		    					}
    		    			 	}, 
    		    			 function(){});
//        			}
		    		
	    		}
        	};
    }]);
});